<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Menu list</title>
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_1566355_2wp6yzal64h.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@2.2/lib/index.css">
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <link rel="stylesheet" href="css/Menu list.css">
</head>

<body>
    <div class="container">
        <!--header start-->
        <div id="header-title">
            <header class="header">
                <div class="header-wrap">
                    <div class="left">
                        <a class="header-ico ui-link" href="sort.html">
                            <i class="ico ico-back-black"></i></a>
                    </div>
                    <div class="header-title" id="top-title">
                        <h2>热菜推荐</h2>
                    </div>
                </div>
            </header>
        </div>
        <!--header end-->

        <!--热菜顶部start-->
        <div class="title">
            <h1>
                <a href="" title="热菜">热菜</a>
            </h1>
            <span>
                <a href="" class="on">最新推荐</a>
                <a rel="nofollow" href="">热门精选</a>
            </span>
        </div>
        <!--热菜顶部end-->
        <!--热菜列表start-->
        <div class="alist">
            <ul>
                <li v-for="it in menuList">
                    <a title="it.title" href="food-detail.html">
                        <div class="pic">
                            <img class="imgLoad" :src="it.pic" data-src="" width="80" height="80"
                                style="display:block;">
                        </div>
                        <div class="detail">
                            <h4>{{it.title}}</h4>
                            <p>{{it.detail}}</p>
                            <p class="note">{{it.note}}</p>
                        </div>
                    </a>
                </li>
                <!-- <li>
                    <a title="蒜蓉烤金针菇" href="food-detail.html">
                        <div class="pic">
                            <img class="imgLoad" src="image/hotdishes2.jpg" data-src="" width="80" height="80"
                                style="display:block;">
                        </div>
                        <div class="detail">
                            <h4>蒜蓉烤金针菇</h4>
                            <p>金针菇、蒜末、小米辣、杭椒、生抽、耗油、辣椒酱。</p>
                            <p class="note">15小时前</p>
                        </div>
                    </a>
                </li> -->
            </ul>
        </div>
        <!--热菜列表end-->
        <!--底部导航start-->
        <div class="tab">
            <ul>
                <li>
                    <a href="index.html">
                        <span class="iconfont icon-index"></span>
                        <p>首页</p>
                    </a>
                </li>
                <li>
                    <a href="sort.html">
                        <span class="iconfont icon-fl"></span>
                        <p>分类</p>
                    </a>
                </li>
                <li>
                    <a href="shoppingcart.html">
                        <span class="iconfont icon-shop"></span>
                        <p>商城</p>
                    </a>
                </li>
                <li @click="Select1">
                    <a href="personalcenter.html">
                        <span class="iconfont icon-my"></span>
                        <p>我的</p>
                    </a>
                </li>
            </ul>
        </div>
        <!--底部导航end-->
    </div>
</body>
<script src="script/vue.js"></script>
<script src="script/axios.min.js"></script>
<script src="script/SHA1.js"></script>
<script>
    var app = new Vue({
        el: ".container",
        data: {
            menuList: []
        },
        methods: {
            Select1: function () {
                //alert("66666");

            }
        }
    });
    var now = Date.now();
    var appKey = SHA1("A6029466653976" + "UZ" + "6C293257-23ED-3634-AD1D-B81D73CD4251" + "UZ" + now) + "." + now

    axios.get('https://d.apicloud.com/mcm/api/foodlist', {
        headers: {
            "X-APICloud-AppId": "A6029466653976",
            "X-APICloud-AppKey": appKey
        }
    })
        .then(function (response) {
            // _this.goodsList = response.data;
            console.log(response.data);
            app.menuList = response.data;
            //alert(JSON.stringify(response.data));
        })
        .catch(function (error) {
            console.log(error);
        });
</script>

</html>